package com.faceye.core.repository.mongo;

import com.faceye.core.util.DateUtil;

import java.util.Date;

/**
 * QueryDSL 做日期查询时的时间对
 * @author haipenge
 *
 */
public class DatePair {

	private Date start=null;
	private Date end=null;
	public DatePair(Date start,Date end){
		this.start=start;
		this.end=end;
	}
	public DatePair(Date dateCycle){
		String dateStr= DateUtil.formatDate(dateCycle,"yyyy-MM-dd");
		String startDateStr=dateStr+" 00:00:01";
		String endDateStr=dateStr+" 23:59:59";
		Date start=DateUtil.getDateFromString(startDateStr);
		Date end = DateUtil.getDateFromString(endDateStr);
		this.start=start;
		this.end=end;
	}

	public Date getStart() {
		return start;
	}
	public void setStart(Date start) {
		this.start = start;
	}
	public Date getEnd() {
		return end;
	}
	public void setEnd(Date end) {
		this.end = end;
	}
	
}
